		
/* ************************************************************************************* 
 * CREATED BY:          MYGENERATION
 * CREATED DATE:        2/12/2009
 * PROJECT:             MCWEBSITE
 * PURPOSE:             websiteAdZoneBUL class
 * MODIFIED BY:         None
 * MODIFIED DATE:       None
 * MODIFIED REASON:     None
 * NOTES:               None
 **************************************************************************************/
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using MCWEBSITE.DAL;
using MCWEBSITE.ENTITY;

namespace MCWEBSITE.BUL
{
    public class websiteAdZoneBUL
    {
        public static int Save(websiteAdZoneInfo _websiteAdZoneInfo)
        {
            try
            {
                if (_websiteAdZoneInfo.AdID == 0)
                {
                    return websiteAdZoneDAL.Insert(_websiteAdZoneInfo);
                }
                else
                {
                    return websiteAdZoneDAL.Update(_websiteAdZoneInfo);
                }
            }
            catch (Exception ex)
            {
                throw new Exception(string.Format("Error on insert theme : {0}", ex.Message));
            }
        }
        public static int Publish(websiteAdZoneInfo _websiteAdZoneInfo,string AdAction)
        {
            try
            {               
                    return websiteAdZoneDAL.Publish(_websiteAdZoneInfo,AdAction);                
            }
            catch (Exception ex)
            {
                throw new Exception(string.Format("Error on insert theme : {0}", ex.Message));
            }
        }
        public static int Remove(int _AdID)
        {
            try
            {
                return websiteAdZoneDAL.Delete(_AdID);
            }
            catch (Exception ex)
            {
                throw new Exception(string.Format("Error on delete Theme : {0}", ex.Message));
            }
        }      

        public static DataSet GetAll()
        {
            try
            {
                return websiteAdZoneDAL.SelectAll();
            }
            catch (Exception ex)
            {
                throw new Exception(string.Format("Error:{0}", ex.Message));
            }
        }

        public static DataSet SelectByFilter(string Info)
        {
            try
            {
                return websiteAdZoneDAL.SelectByFilter(Info);
            }
            catch (Exception ex)
            {
                throw new Exception(string.Format("Error:{0}", ex.Message));
            }
        }

        public static websiteAdZoneInfo Load(int _AdID)
        {
            try
            {
                return websiteAdZoneDAL.SelectOne(_AdID);
            }
            catch (Exception ex)
            {
                throw new Exception(string.Format("Error:{0}", ex.Message));
            }
        }

        public static List<websiteAdZoneInfo> Search()
        {
            try
            {
                return websiteAdZoneDAL.SelectFilters();
            }
            catch (Exception ex)
            {
                throw new Exception(string.Format("Error:{0}", ex.Message));
            }
        }
    }
}

		